package com.barneyx.mshinfoplatform.entity.user;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.barneyx.mshinfoplatform.entity.CommonEntity;
import com.barneyx.mshinfoplatform.entity.enums.EPlatformType;
import com.barneyx.mshinfoplatform.entity.enums.ESex;
import com.gitee.sunchenbin.mybatis.actable.annotation.Column;
import com.gitee.sunchenbin.mybatis.actable.annotation.Index;
import com.gitee.sunchenbin.mybatis.actable.annotation.TableCharset;
import com.gitee.sunchenbin.mybatis.actable.annotation.Unique;
import com.gitee.sunchenbin.mybatis.actable.constants.MySqlCharsetConstant;
import com.gitee.sunchenbin.mybatis.actable.constants.MySqlTypeConstant;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import lombok.experimental.Tolerate;

@TableName("msh_user_platforms")
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableCharset(MySqlCharsetConstant.UTF8MB4)
@Accessors(chain = true)
public class UserPlatformEntity extends CommonEntity {
    @TableId("user_platform_id")
    @Column(type = MySqlTypeConstant.BIGINT)
    @Index
    private String UserPlatformId;

    @TableField("user_id")
    @Index
    private String UserId;

    @TableField(exist = false)
    private UserEntity User;

    @ApiModelProperty("平台标识")
    @TableField("platform_identification")
    @Column(type = MySqlTypeConstant.TINYINT)
    private EPlatformType PlatformIdentification;

    @TableField("platform_openid")
    @Unique
    @Column(type = MySqlTypeConstant.CHAR,length = 200)
    @Index
    private String OpenId;

    @TableField("platform_tel")
    @ApiModelProperty("用户手机号码")
    private  String Phone;

    @TableField("platform_via")
    @ApiModelProperty("头像")
    @Column(defaultValue = "https://imgs.nxhmmr.com/msh/via/def-user-via.jpg")
    private String Via;

    @TableField("platform_nickname")
    @ApiModelProperty("显示名称")
    private String NickName;

    @TableField("`name`")
    @ApiModelProperty(value = "真实姓名")
    private String Name;

    @TableField("union_id")
    @Column(comment = "微信统一开发平台")
    private String UnionId;

    @TableField("token")
    @ApiModelProperty("慢生活用户平台唯一Token")
    @Column(type = MySqlTypeConstant.CHAR,length = 32)
    private String Token;

    @TableField("platform_sex")
    @ApiModelProperty("用户性别")
    @Column(type = MySqlTypeConstant.TINYINT)
    private ESex Sex;

}
